Remove the diagnostic/recovery when two domains end up with the same name. It
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Thu, 13 Oct 2005 16:49:56 +0000 (17:49 +0100)
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Thu, 13 Oct 2005 16:49:56 +0000 (17:49 +0100)
was working around bugs that have gone, and is now more dangerous than useful
-- deadlock is a possibility with this code now.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/python/xen/xend/XendDomain.py
tools/python/xen/xend/XendDomainInfo.py

index 66668ef6e97ca770cb079a83935f32dd65517b24..ce4007b984fa337ad9d85ca462bb94f37d413cc9 100644 (file)
@@ -313,18 +313,11 @@ class XendDomain:
     def domain_lookup_by_name_nr(self, name):
         self.domains_lock.acquire()
         try:
-            matching = filter(
-                lambda d: d.getName() == name and not d.isShutdown(),
-                self.domains.values())
+            matching = filter(lambda d: d.getName() == name,
+                              self.domains.values())
             n = len(matching)
             if n == 1:
                 return matching[0]
-            elif n > 1:
-                log.error('Name uniqueness has been violated for name %s!  '
-                          'Recovering by renaming:', name)
-                for d in matching:
-                    d.renameUniquely()
-
             return None
         finally:
             self.domains_lock.release()
index b387df108d11573ddcb0b0d656d17540c9a5855b..0ff379f7b91c9f27f5188509691e811b211a697a 100644 (file)
@@ -840,14 +840,6 @@ class XendDomainInfo:
             self.state_updated.release()
 
 
-    def isShutdown(self):
-        self.state_updated.acquire()
-        try:
-            return self.state == STATE_DOM_SHUTDOWN
-        finally:
-            self.state_updated.release()
-
-
     def __str__(self):
         s = "<domain"
         s += " id=" + str(self.domid)
@@ -1292,20 +1284,6 @@ class XendDomainInfo:
         self.state_set(STATE_DOM_SHUTDOWN)
 
 
-    ## public:
-
-    def renameUniquely(self):
-        """Rename this domain so that it has a unique name.  This is used by
-        XendDomain to recover from non-uniqueness errors; we should never have
-        allowed the system to reach this state in the first place."""
-        new_name = self.generateUniqueName()
-        
-        log.error('Renaming %s (%d, %s) to %s', self.info['name'], self.domid,
-                  self.uuid, new_name)
-
-        self.setName(new_name)
-
-
     # private:
 
     def generateUniqueName(self):